OK.
OK, so I would like to welcome all of you on today's session, it is day three advanced, so I make
like a court date.
The ad means the third day on the advance, the topics.
So today we'll see hooks and tape manipulation from events.
Before that, I was asking Garani for help.
I have the VIPs instance which get corrupted with the comments installed and it get corrupted and no
more accessible.
So what I did, I did the folder under GitHub, then I push all my custom app under GitHub.
Then I will reinstall the page, then I will create again the app in the new instance and get full and
McGrady's give me guidance.
So this is one of the usage of the GitHub folder, as we saw yesterday.
So any one of you have questions or doubts about any topic from previous sessions.
Reason is, if you have any questions, let us know will clear the doubts.
There was a question regarding a timetable of charitable.
I don't know if you guys did some research on that, how to accomplish it.
Yes.
Yes, you are right.
I forgot your email, actually.
Yes, I got your email, and, uh, I don't have an answer.
I will take notes.
I take notes on that kind of James.
I don't know, Karen, if you have any concerns about child of a child.
No, not at the moment.
Not at the moment.
OK, so let me I will take I will make some R&D about this.
But my feedback, quick feedback, it is not advisable.
It's doable.
But, uh, I don't recommend this.
You have to redesign it in a way that, uh, to accept only parent to child, one level child of a child
is not recommended in therapy.
This is my quick answer.
I will let you know.
But, uh, more development later.
OK, welcome.
Let's start Garani, can you introduce the today's topic and the way forward?
Sure.
So let me share my screen so that we jump into it immediately.
Good, so, um.
We are looking at topic number two, like mommy has already pointed out, this is and duct tape manipulation
from events, I know that this topic is very closely related to topic number seven.
So if time is on our side, we are going to combine the two using events to manipulate dog types.
So let's jump into this.
So hoops, hoops in in Europe next, ideally is like it's like those of you who who have used the jungle
before, it's like jungle signals.
You know what happens in the jungle sicknesses once you have done something on one on one application
or maybe on one document or one model, what happens is that the application automatically triggers
another event to happen in another place inside of your court where you have instructed it to take place.
So our use here in Europe next is something like maybe we are saving.
Let me let me start my server.
Chris Lawrence for us in Mosul.
Let me start this over here.
Start and.
I open this thing, it seems cut up.
Yes, I know it's not manmade, so you really are using.
You said that it's a kind of signal after an event, absolutely, yes.
Does it include the Koran does not?
Well, partly I don't know how to answer your question, because the whole point file is also they find
out that has this CÉDULA, which asked you to remember you are looking at Quran.
It may increase the font here.
Also, you remember I don't know whether you are here when you are looking at the Quran job, this cédula.
Are you here?
Yeah, yeah, yeah, so this is also found in the Hawks NPA file, so they think we are coming to look
at here is this event that occupancy is also part of the.
What is in the hoax file of frappé?
So any application, Minnesota will come with this thing bootstrapped out of the box.
So these events, the hoax we are going to be writing here is what I am saying is, like I said, you
know, in Dongo.
So you can you can you can give it command here like we are going to be seeing in a few minutes apart
and afunction and then about to talk to you whatever you want, executed.
And then you connect it to some event, which, of course, now when this when this is reached, for
instance.
And quickly, we have an update on console, on trash.
And many of us we are going to be looking at from the recommendation when that event for that particular
event is triggered.
This thing will go ahead and call it the other method that is here.
So, yes, it is like I said, you know, in jungle.
What about the Koran?
I don't mean the duck event, I mean the Koran event.
It's the same Quran event for a scheduled event.
Yes.
Is that the same or not?
I mean, the schedule of events, uh huh, Seema's.
We can we can we can launch cultural events relying upon documents.
No, no cédula events.
This one is basically as cédula.
So unless if you write logic to do that, maybe you're right.
The logic that triggers that idea I asked you here is made to run at a specified, specified time of
the day, all of the week of the month.
So I said runs on what has already been scheduled for it, but adhoc event is triggered by some action
taking place in maybe some part of our DOCTYPE within your system.
OK, yeah.
OK, thank you.
North Korea.
Yes, yes, yeah, so good.
So let me reload this and I log in, so I will saying let's say, for instance, you want to administrator,
you want to win, you save a library working on our library, our library up.
Let's say you want everything you save.
I knew I knew a new article inside of your library application.
You want your system to go ahead and do something else, like maybe create a note and tell somebody
or someone I don't know, maybe create a note and tell people that there is a new article that has been
added.
So what is going to happen is that you are not going to be asking people to go ahead and create notes
every time an article has been added.
But rather, the best way to do this is you create an article here in the system on the background to
go ahead and create a note and civic and maybe now from the creation of a..
If maybe that's not supposed to be, send us an email to somebody else.
You can trigger that within the same application.
So ideally, our Hawksworth is the moment I add something here on this one, we are going to be seeing
this example.
I put them I put a new document here in our new article here.
This thing is going to run another function that is going to do something else.
So if you come to the documentation here for documentation, for documentation and you look for controller
controller, whoops, controller, whoops, you look for a number of documents here, look for one specifically
one that is talking about controller whoops.
This one in this case it is this one.
And I have opened it here already.
And we can also go ahead and share this link with the.
For instance, I can just drop this on the chart.
But you can also have a look if you scroll.
You can read this for yourself, I just want to show you the kind of functions we can tap into.
These are the hooks that we have.
So these are controller hooks.
So if you look at these, Kinealy, you you notice that these are just like the methods we had, the
videos we are talking about where you can you can do something about maybe on the inside they are like
functions inside of our of our class for every DOCTYPE.
So, for instance, if we came to our DOCTYPE here library, library DOCTYPE and we entered the library
articulate, I remember we had this class class article library and inside here we have methods, we
have validated we have before Sèvres.
So the kind of controller actions or controller hooks that we can tap into.
If you look generally and closely, you'll notice that it's almost the same thing.
So we have those before submit.
You can do something after on all these events.
So we have Valide to help before save after that.
So maybe have the inside now of our article, you can do something else.
Great.
So you are going to go in and look at this and maybe you can try each one of them on your own.
But on this one, let me let me show you maybe what we can do here so I can close that on our hooks.
Just above this cédula events we have we have a section we for events.
So you uncommented that this thing will come out of the box?
Every time you create, you create a new app that hooks note before it is created out of the box.
You don't you don't need to create the new A file.
And also most of this code that you see here, most of these who do come with this file.
So in their apps that you have created, we already have dog events.
So this one will come with with only one one one one item added.
And this asterisk, like most of you know, basically this means everything is just like an Eskimo syntax.
So this means everything.
And what this means is that on a very DOCTYPE, let me open up Europea next.
If Europea next hope so that I can be able to explain this.
So Europea next and I can look for the Hawks file this one and then I look for the I look for the documents
and I'll look at this here and create a more space.
We have documents, we have the first one here with an asterisk, just like we have on our DOCTYPE.
And then we have some Meadow's here.
Ideally this is the method and then this is the dotted path to where your function is.
So Yueyue, a method is.
Now look at this other one.
Of course here we have for.
So what is this is is that on every single doctor, if you have this one on every doctype validated
and when you where you are validating it ran this function.
So on every talk that this is going to happen and then likewise on submit, this is going to happen
on update after submit on updatable, submit this one and likewise the other one.
Then this is talk entry.
What this thing means, this is the stock entry DOCTYPE.
So when something like on submit happens on the stock entry, the duct tape ran this function and then
this one, when you cancel a stock entry they run this other function.
So for instance, you can imagine like you have been entering our stock entry, you have some data or
you had, you had your DOCTYPE, you had you had some some data on the duct tape.
It's maybe an entry you have and it was submitted and now you are cancelling this particular item every
time you cancel this item.
What is going to happen is that your opinions on the background is going to run this.
So let's say, for instance, you are working on an app and you have your dog that you have allowed
on submit and you need every time someone council's a document that is already submitted, maybe go
ahead and do some other things on the background on your application.
You can implement this particular this this example we have here so that your application when I this
particular date has been canceled.
Rantes, maybe you want to delete some things from the database.
Maybe you want to trigger this council instead of other stuff like that.
And then we have all these others we have used out of there.
We have communication and so many of us who can go and look at them during your own free time.
So this what we have here, what Frappé House initially is for us here, is something that will happen
on every dog event.
So we may not be interested in this.
We can just copy that.
And then I put a comma pasted and then I can just come this out.
And then here, remember, yeah, we need our duct tape, so the duct tape that we we we are working
on today is the article about duct tape.
So I can just go ahead and copy this.
And I put it there.
That is the article I brought up and then here I need a function, but I want to run.
And remember, he said, this is just like this, just like a method.
So I get to hear it.
So I want you to flip this thing when I'm leaving.
And then this is the dotted path to whatever function you want to run so you can decide to come here.
Let me compress this one so that you get some space so you can decide to use any file that you have
here.
So I can decide to use tasks.
I can use utils.
I can decide.
Excuse me.
One more one one second.
So sorry about that.
I think there's only so I can decide to use any of these files we have here, or I can go ahead and
create my own file, so it's up to you.
The only thing you need to do is just to provide a notepad here.
So let me open new deals and we can just use this for the purpose of our testing.
And then I define our function here.
I'm going to go to court maybe something like guests who can call this whatever you want to call it.
And then this function, if you are going to be calling it inside of this file, is going to take in
two parameters.
And the first parameter is the document and the other one is the event event.
The event that you passed, you are passing here.
You are passing here on on your doorstep here.
So this function would take two things.
We have the document and we have the event.
Then we can come here and do something like let's just print for now.
Let's print dock and see what is inside the back door.
OK, so if when we have this thing here, we can now go ahead.
And in our case file, we provided a link or the dotted path, the pattern with the link to this function
we have here.
And what is that path?
Immediately, you see we have library management here, so we can just copy it from here.
Have library management update, our function is our finest utils, and then we have what we call it,
you call it.
We call it the best hope.
So I can copy this again and declare.
Safe and I am expecting that this is going to be called every time when I try to save a new dog, a
new library article liberally, and it is going to print the document that I have got here so we can
actually go ahead and maybe read this, do this and remove this.
And then just so that you can see where we have printed this, then I can provide my document here and
then I can also provide the event that we have called and then I can create some more space here.
What it sounds like someone has a question here.
You have a wrong path in your Hooke's util.
Also about this utils, thank you so much.
That is not the energy of adventure.
Thank you for that observation.
So let's go ahead and try this thing.
So what we have done, we have provided our duct tape and then we have of our method here and then so
it's going to run on this event.
And then I thought that the path to our function here, this one.
So let's go ahead and see whether this is going to work.
So this is Python.
So I don't need to reload this.
Let me say the very.
It's.
Who?
Tim.
This has been seamless.
Yeah, you see this one now here visiting hours as well as has logged in to things.
Number one is the one we have passed.
And the reason why this one is printing like this is because we have added only one item in our DOCTYPE.
So this is the DOCTYPE.
And then here we have the the dock, the dock with the item that we have passed.
And then here we have the function, the function that we the event that we call it.
So it's printing here basically because we have also printed it down here and I am seeing this one has
printer like this, like what we are seeing here, because we had we have only added one item here,
only this.
So if we opened this like this and then we added the three tests to and then we also add over something
like that, ISBN, maybe something like that.
And we save.
Are they safe?
This is going to look a little bit different and why is it not showing any aristocracies?
Mr. Tomizawa.
And I wrote my document.
Zahra is restarting.
OK.
So I can I can I can create a new one great new article liberally, and I call this maybe something
like what this does something like that.
And then here we have over.
Is this the.
Whether or not and that's enough, that should bring the difference, it will become here article reached
out to validate.
This is not what I am expecting here, but you get the point, you get the point.
This thing is going to come with everything that is on this document.
So suppose we wanted to only access look at what we have here.
We have the article and we have whatever was passed, whatever was passed in the title title field.
So whatever.
What if we needed to access maybe something within this?
Maybe we need to write some logic that will do something with a publisher, maybe someday with a publisher.
So what we can do is we can just access those things, any of those things here so we can do something
like Doc Dot, publisher, publisher.
So if assuming I have a publisher, assuming I have written that properly.
Publisher, yes.
And I provide a publisher here, maybe something like Macmullan.
And when I save and make sure I save this, I am expecting this thing to bring Macmillan here, we can
remove this dog event.
You don't need it now.
I'm expecting this into print, only the publisher so I can save it.
And I go back here and I have camera, so I am able to assist in the field that is inside this document.
Now with this, what if I want to print maybe something like the article?
Let's say this is two thousand and I want to print to get the article inside my hook here.
I can do that.
And then article post, article post save hoping I have spelled it out correctly and then I try to save
it saved and we have two thousand here.
So I hope you are getting that so we can have questions if there are before we go to now.
We have by doing that we have already looked at who and how to implement them.
And now I would like us to connect that manipulation of duct tapes with item number seven here.
So if you have any doubts on what you have covered in terms of in terms of connecting this hook, this
will here with your function, please let me hear the questions now.
Yeah, go ahead.
So I see there's two two way to react on an event you did using the hook fail, but since Article Library
is our own custom DOCTYPE, we could have go into its controller and just put the validated method there
without using the hook fire.
Right.
Yeah, you're right.
You're right.
There you are.
It's the only difference.
Is that what you put, what you put in the file here, the DOCTYPE events for instance, if you go to
the our house let me go to our looks here like for instance, here a revalidated here.
We can do exactly the same thing here.
The only thing is that this is done only only on the on the event.
So this is treated as an event.
So it's like a signal in jungle.
So this is treated like a trickle down is when you put logic here.
What happens is that this thing, this thing is normally like let's say, for instance, validate what
happens here, is that this thing is checked, is checked without having to go down this thing.
But when it is on a hook and especially I took that event here, it's just treated like the exact way
that jungle treat signals.
So after something has happened, then check what else do going to do then the rest of the things are
done down here.
You are any mute girl.
Oh, sorry.
I will.
Could we say that the duck duck events in the Hooke's should be used only for a duck type?
We are not managing the source code example, some duck tape from IRP next.
And we would like to react to some event since we don't have access to the controller source code,
then we use duck events.
You're right.
I'm
sorry I didn't get the last point from game.
Can you repeat it?
I was saying that in the if you go into Hooke's the duck events there, it should be used only for,
uh, for, uh, duck type external to your customer at DOCTYPE.
You don't have access to the source code because if you have access to the controller code, then you
can put directly the even name inside the controller and code.
So there yeah.
If I understand you that you want to say I'm saying anything, if uh in our custom I create a new article.
A new user created anything, any example.
So this new user get created, it is in an external up, right.
So in this case, we have to use hooks, right?
Yes, it's mandatory to use the hooks, in other case, if you have validation like validation, hooks,
controller hooks, it's available in the controller of that DOCTYPE, so no need to put it again in
the hooks.
But it is doable system accept and even it will run both validation, whether it is in controller or
in the hopes.
Both will run, right?
Yes, yes, the bull run one year.
OK, so I have opened, for instance, here I'm in the accounting module, which is module for ERP next.
I have their controller here.
So what gives me strength to pass across is if you come to this thing and you write your code here on
update, you have already started editing Europeanised files which are most effective.
And the next time they release their update, your output is going to be overwritten.
So to be safe, you just if you need to do something on update of this accounting account, for instance,
you are going to call this function, but then you are going to write your code or you're going to connect
that to a hook.
So every time something happens on that, it is going to call a hook and do something else, run code
that is inside of another file that you are in control of.
OK, we have a question from Asia, Minhad, Asia, can we do the same thing in JavaScript hooks?
No, we cannot we cannot write the hooks on JavaScript.
Unfortunately, it is python stuff.
OK.
OK, now, uh, I saw you raise your hand if have question.
Yeah.
Garani the only way to see what was happening to track the event.
The only way is the two to check the concert.
There is no log files for four event institutions there.
Is there any any log files for the Øyvind to track Hooke's?
Well, I have not used any log file that is on the dot that is on the front end.
Everything that I normally use is within within the command line.
OK, yeah, can you print message garani from Hooke's, you print message.
Yeah, yeah, sure.
Not so this one actually.
This is a print.
So if we can do something here like this is our first, this is our test and then the duct tape cost.
So if we save this and we can't lock up and we change something, maybe that's up to 200 here and save.
This is going to have this is artist in to the.
Well, no, I mean print message on the front end.
Yes, yes, yeah, you can you can also do that.
So you can just do something like frappé dot management print.
Yeah, you can do that.
Yeah, you can do that as well.
This is from can do that.
So if I come here and change something like, you know, I'd not move that and save.
You see, this is a money accident, right?
So this is you can trace your hooks, can you can you can you guess the the event not to not to to massage
it to, um.
Put I mean, put the event on the on the message, can you cast it and put it in the message?
How would you feel if I understand what you mean is I like that.
Document the.
Or what you mean is we save this like we have available here and we have this, but what what am I doing
here?
No, no, I mean I mean, what's what's what's
this thing in the council?
Can we put it in the message here?
Uh huh.
Your message should print that article.
No, no.
The heart after the what is this thing on the council after the event, for example?
Uh, this is the starting this debugging is active debugger.
And can we.
Oh, this one.
Yes.
Can we put them in the message or the on the message here.
Yes.
Well, OK, this is something that is really why we do not have control over this.
The only thing we have control, because this is just like like this is this is this is like a log that
is done by by frappé themselves.
So when you run it, it keeps tracking this.
So what do you have control of is what we have?
Maybe something like here.
I do not have the way right now to maybe render this on the front end.
OK, no problem.
OK.
I have a question regarding the path that the that path is.
Yes.
This is what is the scope.
What is the limit of it should be in the same model level or upper level or what we can put in the other
custom app.
But this one you do not this one has no limit.
You can put anything as long as you have provided the correct path to wherever you are.
You are you are phylis into a function.
This is going to college.
So even if you are outside like now, we had another up here code something else and you want to call
this up from here.
We just provide the power here and it to call it from the.
I mean, here and in your case, library management, dot utils, library management is the module name,
right?
Yes.
Yes, you did it, why you didn't put the application name up, name, for example.
You mean like why are you it in the module name, it should start from the module if everything starts
from the module, just like we are doing even in the on the on the schedule events like you do everywhere
from in Europe and Frappier, the dotted parts, including in the Apeace, we will start from the module
level.
OK, yeah, so Mordialloc modu and then the.
So remember, this could be it could be you could be having an affair at upholders here like just one
second like I can, I can decide.
I want to group my things here, maybe into services, maybe I want to put these, these, all these
utils and everything into.
I don't have all the services, I can just create a folder called IT Services, put my utils file inside
of services and out here you just need to provide those services, dot, whatever.
But I mean, I guess my question, should the Hooke's file is proper to a customer.
Each customer has his own hooks file, right.
So wherever exist the Hooke's file, it will manipulate the modules under the same customer.
Not necessarily the same.
You can even manipulate you can you can use this event, an event on the other library to manipulate
something that is not even within this.
OK, yeah, so you put module name only module name is enough without custom the update.
Yes, yes, yes.
The module name is enough.
Yes.
So uh module name.
It cannot be repeated in the full implementation means.
In the full instance we cannot have two modules.
Same name.
Right.
Yeah.
Why would you have to modules with the same name in the same application.
I mean, you eunuch, the module name is unique, is managed by frappé, and it is unique.
I'm not I'm not sure I cannot be in the position that is unique.
Yeah, I mean, if you go if you go to IRP next up and drill down under IRP next up, this one.
Yes.
Then again, IRP next, what is your model, for example, a model accounts.
Yes.
This is something.
Yeah.
If I want to take to make a article library validate, I will run something under this account.
I would write accounts that whatever files exist there.
Yeah, you're correct.
There is a counter.
Yeah.
You put in accounts and then you go to your data and you give it back to whatever function you want
to call.
Yeah.
OK, fine.
Yeah.
Thank you.
Good.
You're welcome.
OK, so we are going to go to the next level.
So now let's see.
Let's see how long we can we can use this thing, I'm going to use this information because ideally
I just want to demo this.
But now I want every time we have let me duplicate this and create this, I want everything.
We save a new.
A new article I want us to save, and so let me open or not.
Oh, this one has a lot of notes, I was running around with this thing, so it's running, it keeps
running and doing things here.
I mean, this.
OK, let me just delete it from here.
So.
We have training.
Proper training.
We have arbitrarily upturning.
And then we can look for Tabar notes, maybe page three notes.
Yeah, this one.
And we can track it.
Yeah.
So this should be empty now.
OK, so I want us to create a note here, every time we we save everything, we save a DOCTYPE.
Yeah, this one is not empty.
I want us to create a. everything we to add a new a new article here.
I want us to create a..
Alongside it.
So our do triggers are such a function from within your instance.
So we can go to our house and write write another function.
I think we can do we can do after.
And then we give it up and appropriate path to our our function, the function that you want to save,
to call in this one, we can just call it safe not.
So if not, we can quote it is it is within the utils file so we can come here and we define our function
and we call it, if not, remember this one after taking a dog in an event.
And then not here, you need you need to you need to know how to write this thing are the function that
will be called when the top is successfully.
So building this thing picks, including so we can do something like load equals, not equals.
Not equals, and then what are you going to do here?
We are going to get the duct tape so we can to get it, OK?
Remember this then this document is going to have to have the name of the duct tape that you want to
get.
So this is not we are going to provide the name of the
document, I think is document.
And then here we are going to provide the document.
Is it is that is not.
And then what you're going to do is we are going to put in what you want to see inside of our document
here.
So if you come in, try to add to this, you notice that there is only one thing that is mandatory here,
and this is the title.
So we can just add the title and that's it.
So what you're going to do is we are going to provide a title.
It should be inside that title and then we provide the title is we can just access the document that
we added here and say something like something like Dog wrote.
What is the name of our article?
Let's see this one here when we're adding it is article name so we can do doctored article.
Again, to talk to Dr. Addicott, namely the dog is the dog, the article name.
They may be I don't know why this is complaining, let me see why this is complaining.
Equals the article name dot, dot, dot, dot com name, then you can provide we can give this here.
We have a. we have a comma there, so this is saying we are not allowed within our set.
They told us.
OK, OK, OK, give me a second to check the check here, let me see what I'm getting wrong documents.
I think I heard something some something like that written somewhere.
Give me a second give me a second to check this, so if you have questions, you can bring them on board.
Let me check what is going on here.
Once again.
So if you have questions that you can, you can bring them as I check what I'm getting wrong.
Kim.
The Garani.
Yes, yes, mommy, can you check on he shared the syntax to create a new document so it is proper to
get Dirk DOCTYPE.
You have to give the doctor's name and title new task.
I think it will help this.
Yeah, yeah, yeah, I see this, so, yeah, I have that I have that in mind here.
Don't waste it complaining, doc.
I think, Karen, you use after insert after insert.
Right.
Go back to can you share your screen.
I show myself just a minute, just a minute.
It is coming.
Yes.
In your books, there is no after insert in the list, there is before, after Saboor.
What hooks you use?
Yeah, this, this, this, this will not be the issue, the issue must be here.
I don't know why this tattoo is getting underlined.
Oh, sorry.
We had we had we had a comma here instead of here.
We put a comma instead of instead of Apollodorus would be a problem.
Not not OK.
OK, so so now we have it.
So now this note, we can go ahead and do note though, the insert, note or insert.
And sometimes sometimes if this doesn't work or you can just do Frappier, don't repeat it, sometimes
not.
But inside doesn't doesn't reflect this thing.
So if you find this for some reason, this doesn't fit in the database, just add this other thing and
that should be able to walk now.
So you are saying something about the about this.
Yeah, there is no aftershave, the function is and let's check the documentation is before I went off
the inside, the software inside, correct.
Well, yeah, let's go ahead and test about now, this is I don't remember if your home is on the back
end, you do not need to restart your server sometimes because this of course, this is a bug in JavaScript
is what you have to endeavour.
You have to reroute your browser.
But in Python, you don't have to sit and wait and try to do this.
This this thing is running a current job.
So I may need to.
I may need to.
I may need to stop this.
And they make it so that this thing stops running into my great.
Bench Margaret or bench started.
This thing has to be running so that we can go ahead because ours is saving our saving in the name of
the documentary having started.
So even if we have others here with me, this is a randomly generated string.
So, I mean, yeah, I was generating a random string and then inserting is that are not so we yeah.
We can ignore this.
We want to see how this is going to save the article.
The title we give to our article is what is going to be saved here as the title of this note.
So it can't be a random string like this.
So let's go ahead and at our article and see
Article four article for something like Hoopes is five.
If it we have an error saying this release is not just just.
Let's see why that is complaining.
And.
You have an extra Kerma at the end of title, I don't know if it can be this well, I don't think so.
Let's try without it.
No, it's not.
Let me check.
Give me one second.
Give me give me one second.
Let me just debug this and then I get back in a second.
Well.
Oh.
No, no, no, no, no, no, don't call.
Again and again.
Oh.
By the way, regarding the shared folder, all of you are able to access no issue.
Because Osama today was unable to access.
Did you try Osama today accessing shareholder?
Yeah, I have to run my my personal computer.
No, no, even your your, uh, professional computer.
I have did it right from your professional computer.
Not personal.
It should work, should work, and password is Frappier 20 21 if capital.
So I think only you cannot access others.
I appreciate it.
Today, another link.
And I hope to work for you also.
It's in the
Tribune.
Uh.
So Karani, I should add another snippet.
Can you check?
So this single court petition, doctor's name, so I've seeing actually our court looks perfectly fine,
so let me let me because let me share my screen here.
Is there any library not important?
No, no.
Really, we don't need to be important for this.
So let me let me let me explore this.
I think I'm going to let let's see.
Because, you see, this is this is the syntax.
This is the exact syntax we need to do here.
There's nothing fancy a set, simple code or double code either, unless do this one, because this
is what they have here.
What is inserting what is inserting those the notes with with a current job is this one new note for
Dog-Eat-Dog in the document is that in the data is the node.
So here is this where I'm generating a random string.
So I will have to check why it is not working with a hook.
And then and then maybe I can I can address that that issue tomorrow instead of instead of spending.
Can you.
Comment, the comment, the last sentence, comment, this one.
Yeah, the comment years without it, and it can't be that Jimmy and me just save you see still or restart
server.
And he starts working.
Distorting anything here?
Nothing.
Also, we learn, by the way, from debugging, we learned from that because anyone can get the same
errors and we don't know how to do so.
OK, I will tell you.
Can you comment on the hoax over a comment and all the hoops, what you had commented?
Yes.
Return to the initial stage.
OK, yeah, this one, yeah, yeah, you comment well, whatever is giving it commented.
That one now, you know, we don't have this, we don't have anything, so this is going to save.
Yeah, that one saves the accident, so it would start adding point by point.
And slowly, slowly.
So now let's look at many things at the same time.
Add one things at a time.
Got rid of the these of the sort of the things that you want to call this utils save note.
Save it.
We have this one.
So let's see whether this one gets here actually.
So frappé not the rule and say we are here start.
Yeah.
And then I try to save this G.K save.
He doesn't call that function.
Yes, see?
After inside, so you have, uh, saved your file.
It's it's it's a bit of a civil case.
Sorry.
So am I giving our own.
Oh, by the way, I have a question.
Maybe the difference in the controller looks.
So it is before they validate, uh, before submit.
All are very similar.
So who is running before.
You got my question, Karen.
Oh, no, it's hitting it what we did.
Remember, remember, this is getting there.
This is we are doing it after means it is.
And this only happens once.
That only happens when you are saving it for the first time.
So if you edit and you try to save, it is not treated as after insult.
Yes, it's only called once, and so we have to outset the article, but then here we have we are here.
So this is what we do.
This is through.
So now if we try to edit something here and to see to not it's not supposed to call it, it's not supposed
to call it because, you know, reload this reload and we try to edit.
Do you want to see a troll?
You did a through error, does does it cancel the insert database if you are in the after insert?
Sorry, not it will not it will not stop this one, only stop.
Let me go back.
This one Rapido through will stop this execution here.
But remember, this court, this court is only polt when this one has already happened.
So their who will be called after the article has been inserted successfully.
So it's not in the same transaction, it's a new databased transaction where the first one is already
committed, correct?
Yes.
OK, so let's see whether this will save again.
Save you see, this does include everything that this does, including things that sort of things that
is only called when you are saving a new document like 50, 60.
This one is called.
So now let's see, so we are here, it's getting there now.
You want to say Karani that after insult will happen only for a new record, not update existing, not
upgrade existing.
Yes.
So you have to select the right even hoops, you have to select the right in the right event.
So let's see what goes through the title.
Let's see what happens there.
So remember this one, we have to create a new one.
Fifty 57.
See if it is one does OK.
So it is working here now.
It's there.
It is fine.
So the problem could be duct tape, not.
And you get at the issue, you know, maybe it's not loose and everything is working up to there.
So let's go and try to create a new one.
New article is Fifty Eight Swivet Twerked.
So now that's what is refreshing.
See?
Yeah, it's here is what.
Congrats.
So I don't know what was wrong with our theme.
What was it.
This one.
And some go back and see go here, a new one.
There's 59 in Save.
Oh, yes.
So the problem is in the hope file.
Hmm.
Um, why is a different article, I believe it means that.
OK.
Oh, kay, what is your method, your test?
What is the test tube?
Underutilized as to what is doing the message print.
I'm looking at it or commented or whatever.
The problem could be here.
Actually, yes.
Yeah, so let me just pass is not what's.
So a new one, that is.
But to tell.
Yes.
He has been a certain.
The issue was also with we have commented the comment, comment for the comment.
So you know that uncertainty is enough.
Yeah, I do think that is enough sometimes.
Sometimes if it doesn't work, just add property, something.
Sometimes this one doesn't.
I don't know why and I don't know exactly when, but sometimes you'll find this one of the exciting
things in the database.
So I want you to just add this other every time I add this one to us.
So this sometimes I cannot accept it.
But since you are experience, you have experience with it.
Yeah.
You know, what I am saying sometimes is yes, it is actually.
Sometimes because I think thinking is, you know, frappé, especially when it comes with Europeanist.
Some things you remember the other day, we were also checking we were also checking logs here.
Sometimes it logs, other times it doesn't.
So you can't really explain why is why things like sometimes other times they don't.
But that's not that.
That's how we learn.
We learn from your experience.
We take it out of this.
It's important to tell that otherwise we cannot discover this.
We spent time debugging and we don't understand why it's not inserting.
Yeah, yeah.
Yeah.
Great.
Yeah.
So so now that is, that is manipulating, that is manipulating, manipulating dog types.
So by this, by doing this of course now inside of this function inside of here you are able to manipulate
so many so any doctor that you interested in.
So if you needed to do something after this article has been saved or maybe before it has been saved,
you want to do something else or after it has been canceled, you can connect that to a hook, access
another door, like we have access to the duct tape here and do something else instead of that duct
tape.
So remember, we use not because it is very small, you only need to add a title so you have no limitation
as to the amount of things you can put here.
Even if you wanted to edit the accounting module, you can do that here.
You just need to provide all the parameters that are needed and you can do that with a hook.
So unless we have questions, my thinking is we we have finished today.
So if if anyone feels like we need to clarify something, please, Michiana.
Yes.
And who has questioned?
Gairm, you have a question.
Or he left, he left, he left the meeting this morning.
I have a question.
Garani, yes, go to the controller documentation with the task controller, the tabatabai, the documentation
ducks' that yes, yes, this one I want to understand every every Hooke's, every Oak's when it will
be triggered.
It's very important this OK, for example, you are saying before submit OK, when I, when I press
the button submit, I press the button, submit.
This is will will be fired.
Right.
Correct.
So if I put, for example, frappé that throe message and the process will fail so the submitter will
not have a right.
Yeah, I do not happen to submit submits.
Remember, submit is in the duct tape.
So you have anybody submit like after you have stiffed you.
Yeah.
So if you need to check some things because remember when you submit a document in frappé, you can't
edit it, you need to answer it.
So we some checks you want to do before you submit a document.
You can do that with this, this, this method.
So let's go through this hooks and let's understand when it will fire exactly this one we did already
did before council council here we are talking about a document that has been submitted.
So the document is submitted and you want to cancel it.
So maybe this is this is the adopted.
We do not allow people to consult.
You do not want people to consult documents that have been submitted so you can just do this.
So the council battle may be there, but what is going to happen is that it is not going to allow people
to council that document or another use case is maybe you need to you need maybe a user and only use
an ordinary user can can trigger the council event.
But you want it is to, first of all, go to the supervisor before you.
The document can actually be cancelled.
So what you're going to do is you are going to place that logic inside the before council event.
So someone is going to click the council button, but it will not the council until when this this is
satisfied.
OK, that is done before council.
Then here we have before update.
After submit.
So this is this document has already been submitted, but you are trying to edit it.
So in this situation, you can see this is called Before I submitted document value are updated.
So if you want to update a document, we are which has already been submitted and there is some logic
you need to do.
Maybe you want to check who exactly is doing that.
Two is they are all going to do that with this function.
Then before you say sorry, before update after segment, now you did you press submit, OK, you press
the button, submit and the document is going to be submitted, right?
Yes.
When before update.
It is there is a time elapsed between these two events.
No, no, no.
I mean, what happens when you submit a document and they want to edited it?
What happens is that you have to cancel it fast, OK?
Not when you cancel this document.
It is.
Again, you can now update that document.
But what happens is that frappé keeps a log of what that what was in that document before you try to
update it.
So if a document has already been canceled and you are not to update it, it's data to something else
you can call this function to do.
That means you have you have to before update one is normal update.
There is another before update.
Right.
Yes, an update on submit an on of plate of meat.
An update there is an update on a is there.
OK, so the make to make difference there is before update, after submission and an update for document
and submittal.
You got my question.
Yes, yes, are right, you're right, yeah.
So next before insert so before you certainly looked at it before inserting, you want to say this is
a new record to be inserted in the database, right?
Yes.
You see, this one is saying before before a document is inserted, inserted into the database.
So if they did, the document already exists in the database.
This function is not going to be called.
It is record level now we are talking on the event at the database level, not in the front end, not
like a button get pressed pressed button or a move outside the field.
This trigger is at the database level, right?
You're right.
So now that these things get triggered, when the database will insert before inserting a new record,
this is get triggered.
Yes.
So before naming this is cause for the name of the visit, before naming this again happens just it
appears almost the same level we've waited for before you start.
But this one is used is used to manipulate maybe the fields, the values of the name property, remember,
name names, property in frap is treated as the default commodity.
So if you need to do some checks to the primary key before it is in the database, you can use before
naming a method, or maybe you generate your own name and maybe maybe you can also do that, for instance.
Is this a place they use it in the patient's DOCTYPE because they use the patient name, they use the
patient's name as the primary key.
And so what they do is that they, first of all, check whether the patient's name may have provided
already exists and if it exists, just to prevent something like, you know, if there are currently
Jofre currently existing, then that is has been used as a primary key in another patient comes with
an image of recurrently they are going to have in the primary care.
Joffre Karenni one.
OK, so the money that we this fund, the accident or to name this is an option on the.
So to name when it's naming it generated after, after all, before, after, after, after all, the
name of not used, let me see an optional method which is called only when it is defined in the controller
a document.
I have not used this this one, but maybe we can explore that.
OK, validate validate validity of course.
Now this one is every time you are putting something new into the database, whether it is a new one,
whether you are editing, it has to go through checks that are inside the validate function.
So it happened before in court.
Yes, it happened it happened before before insert event before you for saving here, before saving.
So whether you want to insert a new record or you have just edited edited a record here and you want
to save it, the validate function is called at all those instances.
So if maybe you had something here that needed to be checked every time, whether I use editing or saving
a new record, the best place to place the logic is unvalidated function.
Back back to the page, please.
I am on the page.
In the page.
Now, you said validate and before say so.
Which one you use commonly you are using validate or used before to so commonly commonly.
And I do validate because in invalided you can, you can also call.
You can do a lot with validity before save before a document is if you can also use this.
But if I did I normally find, I find validate coming in very handy because anything that you want to
do, for instance, even if maybe you want to combine two things, I think validity is superior to to
be false if invalidity is actually called before even the system attempts to save this into the database.
So we do believe it will have done all the validation before it has are the function.
So first things trigger this validate, yes, but it it is triggered first.
Oh, yeah.
Then we have before Steve Fossett is self-explanatory.
This is just before it is sifted the database.
So this is called after valeted as fast as you can do something before you leave.
And then we be right now combining of two names to create another maybe something like fullName.
You can do that before they see me.
Then we have the inside of the inside is dust after this thing has been inserted in the database.
I think we have to use that right.
Yes.
Yeah.
So this this one runs immediately after the document has been inserted.
You do something else, OK?
Yeah.
So on up it is called when an existing document is updated.
So if we come here and update this document and save it, this function is going to be triggered.
So if you need me to do something on update, maybe I'll ask people to document X, Y, Z has been updated.
You can do that with this method.
OK, you have on submit is when you have submitted a document.
So you have I took it out of control.
I mean I don't about where you are allowing people to submit.
So immediately after they submit you can do you can trigger other other other other options we have
before submit and submit.
Yes, what is the difference, the difference is on submit before submit happens, when you click the
submit button before submit is called.
On Submit, this one has already been submitted.
You see this and saying this is called when the committee submitted.
Means before a settlement is before on submit.
Regrette, who is first, it is before submit, because before something happens, before the document
is submitted.
So when you click the button, if he had something on there before, submit method, it will be written
before the document is actually submitted.
So if their tests don't run, the document will not be submitted.
But on submit will call after they submit as happened.
Yeah.
Yes, you need to try this kind of an update after some.
So there it is.
I think it's clear, OK, on trash after delay talking fine because it's confusing.
You see, if someone don't know when to put the right trigger, which trigger you use, it can be wrong.
You, Andrea.
Yeah.
OK, that's it for today.
Thank you.
If you don't have a question from.
The team.
Anyone has questioned.
No question, not everything is clear.
So we.
We will, uh, the the recording will be available maybe after 15 minutes, half hour maximum, you
can download it if you don't if you have a problem on accessing.
Please let me know.
And, uh, shall we meet tomorrow same time.
Yes,
I sure can.
You and Karen, you stay with me just for ten minutes after the call now after the hour.
OK, OK.
We'll continue directly.
We will not break.
So we'll finish today's call.
Thank you very much for your time.
And that's it for today.
Thank you.
I was.